using System.ServiceModel;
using System.ServiceModel.Channels;

namespace Zombie.Services.Definitions
{
	public class InformationClient : ClientBase<IInformationService>
	{
		private IInformationService m_MockSerivce;
		public InformationClient(IInformationService mockService)
			: base(new BasicHttpBinding(), new EndpointAddress("http://fakeAddress.com"))
		{
			m_MockSerivce = mockService;
		}

		public new IInformationService Channel
		{
			get { return m_MockSerivce ?? base.Channel; }
		}

		protected override IInformationService CreateChannel()
		{
			return m_MockSerivce ?? base.CreateChannel();
		}

#if !SILVERLIGHT && !NETFX_CORE
		public new void Open()
		{
			if (m_MockSerivce == null)
				base.Open();
		}
#endif

		public InformationClient()
		{
		}

		public InformationClient(string endpointConfigurationName) :
			base(endpointConfigurationName)
		{
		}

		public InformationClient(string endpointConfigurationName, string remoteAddress) :
			base(endpointConfigurationName, remoteAddress)
		{
		}

		public InformationClient(string endpointConfigurationName, EndpointAddress remoteAddress) :
			base(endpointConfigurationName, remoteAddress)
		{
		}

		public InformationClient(Binding binding, EndpointAddress remoteAddress) :
			base(binding, remoteAddress)
		{
		}
	}
}
